package httpclient;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;

public class Localsource {

	public void getsourcebyurl(String urlString,OutputStream writer)throws IOException
	{
		File sourceFile = new File(urlString);
		System.out.println(urlString);
		FileInputStream inputStream = new FileInputStream(sourceFile);
		 int size = 0;
		 byte[] buffer = new byte[2048];
         while((size = inputStream.read(buffer)) != -1)
         {
        	 //System.out.println("aaaaaaaaaaaaaaaaaa");
        	 writer.write(buffer,0,size);
         }
         writer.flush();
         inputStream.close();
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
